<?php
/**
 * $Id: default.php 4 2010-10-07 14:41:28Z ahmtsari $
 * BF Auction view for BF Auction Component
 *
 * @package    Joomla
 * @subpackage Components
 * @link http://www.tamlyncreative.com.au/software
 * @copyright	Copyright (c) 2010 - Tamlyn Creative Pty Ltd.
 * @license		GNU GPL
 *
 *	  BF Auction is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    BF Auction is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with BF Auction.  If not, see <http://www.gnu.org/licenses/>.
 *
 *
 * Author's notes: When GNU speaks of free software, it is referring to freedom, not price.
 * We encourage you to purchase your copy of BF Auction from the developer (Tamlyn Creative Pty Ltd),
 * so that we can continue to make this product better and continue to provide a high quality of support.
 *
 */

	// Check to ensure this file is included in Joomla!
	defined('_JEXEC') or die();

    global $mainframe, $option;
    $user =& JFactory::getUser();
    
    $Itemid = JRequest::getVar('Itemid');
	$menu =& JMenu::getInstance('site');
	$config = & $menu->getParams( $Itemid );
	
	$currency = $config->get( 'currency' );
	
	$items = 0;
	$limitstart = 0;
	$limit = 0;

	jimport('joomla.html.pagination');
	$pageNav = new JPagination( $items, $limitstart, $limit );
?>

<div id="editcell">

	<table class="adminlist">
	<thead>
		<tr class="bfauctionReportHeader">
			<th width="5" align="center">
				<?php echo JText::_( 'ID' ); ?>
			</th>
			<th width="10%" nowrap="nowrap" align="center">
			    <?php echo JText::_( 'Category' ); ?>
			</th>
			<th>
				<?php echo JText::_( 'Title' ); ?>
			</th>
			<th width="10%" nowrap="nowrap" align="center">
				<?php echo JText::_( 'Current Bid' ); ?>
			</th>
			<th width="10%" nowrap="nowrap" align="center">
				<?php echo JText::_( 'High Bidder' ); ?>
			</th>
			<th width="10%" nowrap="nowrap" align="center">
				<?php echo JText::_( 'End Date' ); ?>
			</th>
			<th width="10%" nowrap="nowrap" align="center">
				<?php echo JText::_( 'Bid Now' ); ?>
			</th>
			<th width="90" align="center">
				<?php echo JText::_( 'Image' ); ?>
			</th>
		</tr>
	</thead>
	<?php
	$k = 0;

	for ($i=0, $n=count( $this->items ); $i < $n; $i++)
	{
		$row = &$this->items[$i];
		$link 		= JRoute::_( 'index.php?option=com_bfauction&task=bid&cid='. $row->id );

		?>

		<tr class="bfauctionReportBody">
			<td align="center">
				<?php echo $row->id; ?>
			</td>		
			<td align="center">
				<?php echo $row->category_name;?>
			</td>
			<td>
				<a href="<?php echo $link; ?>"><?php echo $row->title; ?></a>
			</td>
			<td align="center">
				<?php echo $currency; ?><?php echo $row->currentBid; ?>
			</td>
			<td align="center">
				<?php echo $row->highBidder; ?>
			</td>
			<td align="center">
				<?php echo $row->endDate; ?>
			</td>
			<td>
				<form method="post" name="adminForm">
					<input type="hidden" name="option" value="com_bfauction" />
					<input type="hidden" name="task" value="bid" />
					<input type="hidden" name="boxchecked" value="0" />
					<input type="hidden" name="controller" value="" />
					<input type="hidden" name="cid" value="<?php echo $row->id; ?>" />

					<input name="Submit" type="submit" id="Submit" value="<?php echo JText::_( 'Bid now' ); ?>" />
				</form>
			</td>
			<td>
				<img src="<?php echo $row->image;?>" width="90" border=0>
			</td>
		</tr>
		
		<?php
		$k = 1 - $k;
	}
	?>
	
	  <tfoot>
	    <tr>
	      <form method="post" name="adminForm" action="index.php?option=com_bfauction">
	      	<td colspan="8"><?php echo $this->pagination->getListFooter(); ?></td>
	      	<input type="hidden" name="option" value="com_bfauction" />
		  	<input type="hidden" name="task" value="bfauction" />
		  	<input type="hidden" name="boxchecked" value="0" />
		  	<input type="hidden" name="cid" value="<?php echo $row->id; ?>" />
		  	<input type="hidden" name="view" value="bfauction" />
		  </form>
	    </tr>
	  </tfoot>	

	</table>
</div>

<!-- don't remove the following 7 lines if you didn't purchase BF Auction. Purchased version BF Auction Pro has no restrictions. -->
	<br>
	<table width="100%">
	<tr>
	<td><?php echo JText::_('Powered by'); ?> <a href="http://www.tamlyncreative.com.au/software/" target="_blank">BF Auction</a></td>
	<td><a href="http://www.tamlyncreative.com.au/software/" target="_blank"><img src="./components/com_bfauction/images/bftick.jpg" height="42" align="right" border="0" ></a></td>
	</tr>
	</table>

